package com.boot.security.server.dao.mffl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.mffl.MfflTakout;

@Mapper
public interface MfflTakoutDao {

    @Select("select * from mffl_takout t where t.id = #{id}")
    MfflTakout getById(Long id);

    @Delete("delete from mffl_takout where id = #{id}")
    int delete(Long id);

    int update(MfflTakout mfflTakout);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into mffl_takout(userid, money, takeoutTime, createTime, updateTIme, sysuserid, bankCardNumber, state, phone) values(#{userid}, #{money}, #{takeoutTime}, #{createTime}, #{updateTIme}, #{sysuserid}, #{bankCardNumber}, #{state}, #{phone})")
    int save(MfflTakout mfflTakout);
    
    int count(@Param("params") Map<String, Object> params);

    List<MfflTakout> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
